home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_tower.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  134 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_tower.cog    Activate an adjoin and it vanishes
  4. #
  5. # [GGJ]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11. message        startup
  12. message        activated
  13.  
  14. surface        sound1
  15. surface        sound2
  16. surface        sound3
  17. surface        sound4
  18. surface        sound5
  19.  
  20. sound        note1=pru_CE_1.wav    local
  21. sound        note2=pru_CE_2.WAV    local
  22. sound        note3=pru_CE_3.wav    local
  23. sound        note4=pru_CE_4.wav    local
  24. sound        note5=pru_CE_5.wav    local
  25.  
  26. thing        bug            nolink
  27. thing        ship        nolink
  28. thing        sender        local
  29.  
  30. surface        RoyNeary    nolink
  31.  
  32. int            CE3K=0        local
  33. int            locked=0    local
  34. int            success=0    local
  35. int            done=0        local
  36.  
  37.  
  38. end
  39. # ========================================================================================
  40. code
  41.  
  42. startup:
  43.  
  44. ClearAdjoinFlags(RoyNeary, 2);    #no move
  45. SetFaceGeoMode(RoyNeary, 4);    #draw on
  46. AttachThingToThing(ship, bug);
  47. AISetMoveSpeed(bug, 10);
  48. return;
  49.  
  50. # -------------------------------------------------------------------
  51.  
  52. activated:
  53.  
  54. if (locked) return;
  55.  
  56. locked = 1;
  57. sender = GetSenderRef();
  58.  
  59. if (sender == sound1)
  60. {
  61.     PlaySoundLocal(note1, 1, 0.0, 0x0, 0);
  62.     if (CE3K == 0)
  63.     {
  64.         CE3K = 1;
  65.         SetSurfaceLight(sound1, '1.0 0.0 0.0', 0.0);
  66.         success = 1;
  67.     }
  68. }
  69. else if (sender == sound2)
  70. {
  71.     PlaySoundLocal(note2, 1, 0.0, 0x0, 0);
  72.     if (CE3K == 1)
  73.     {
  74.         CE3K = 2;
  75.         SetSurfaceLight(sound2, '0.0 1.0 0.0', 0.0);
  76.         success = 1;
  77.     }
  78. }
  79. else if (sender == sound3)
  80. {
  81.     PlaySoundLocal(note3, 1, 0.0, 0x0, 0);
  82.     if (CE3K == 2)
  83.     {
  84.         CE3K = 3;
  85.         SetSurfaceLight(sound3, '0.0 0.0 1.0', 0.0);
  86.         success = 1;
  87.     }
  88. }
  89. else if (sender == sound4)
  90. {
  91.     PlaySoundLocal(note4, 1, 0.0, 0x0, 0);
  92.     if (CE3K == 3)
  93.     {
  94.         CE3K = 4;
  95.         SetSurfaceLight(sound4, '1.0 1.0 0.0', 0.0);
  96.         success = 1;
  97.     }
  98. }
  99. else if (sender == sound5)
  100. {
  101.     PlaySoundLocal(note5, 1, 0.0, 0x0, 0);
  102.     if (CE3K == 4)
  103.     {
  104.         CE3K = 5;
  105.         SetSurfaceLight(sound5, '1.0 0.0 1.0', 0.0);
  106.         if (!done)
  107.         {
  108.             SetAdjoinFlags(RoyNeary, 2);
  109.             SetFaceGeoMode(RoyNeary, 0);
  110.             done = 1;
  111.         }
  112.         success = 1;
  113.     }
  114. }
  115.  
  116. if (!success)
  117. {
  118.     SetSurfaceLight(sound1, '0.0 0.0 0.0', 0.0);
  119.     SetSurfaceLight(sound2, '0.0 0.0 0.0', 0.0);
  120.     SetSurfaceLight(sound3, '0.0 0.0 0.0', 0.0);
  121.     SetSurfaceLight(sound4, '0.0 0.0 0.0', 0.0);
  122.     SetSurfaceLight(sound5, '0.0 0.0 0.0', 0.0);
  123.     CE3K = 0;
  124. }
  125.  
  126. Sleep(1.5);
  127. success = 0;
  128. locked = 0;
  129.  
  130. return;
  131.  
  132. end
  133.  
  134.